3.68 \(\int \frac{\cot ^2(c+d x)}{a+a \sec (c+d x)} \, dx\)

Optimal. Leaf size=61 \[ \frac{\cot ^3(c+d x) (1-\sec (c+d x))}{3 a d}-\frac{\cot (c+d x) (3-2 \sec (c+d x))}{3 a d}-\frac{x}{a} \]

[Out]

-(x/a) - (Cot[c + d*x]*(3 - 2*Sec[c + d*x]))/(3*a*d) + (Cot[c + d*x]^3*(1 - Sec[c + d*x]))/(3*a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0973967, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3888, 3882, 8} \[ \frac{\cot ^3(c+d x) (1-\sec (c+d x))}{3 a d}-\frac{\cot (c+d x) (3-2 \sec (c+d x))}{3 a d}-\frac{x}{a} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2/(a + a*Sec[c + d*x]),x]

[Out]

-(x/a) - (Cot[c + d*x]*(3 - 2*Sec[c + d*x]))/(3*a*d) + (Cot[c + d*x]^3*(1 - Sec[c + d*x]))/(3*a*d)

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rule 3882

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> -Simp[((e*Cot[c
+ d*x])^(m + 1)*(a + b*Csc[c + d*x]))/(d*e*(m + 1)), x] - Dist[1/(e^2*(m + 1)), Int[(e*Cot[c + d*x])^(m + 2)*(
a*(m + 1) + b*(m + 2)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && LtQ[m, -1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\cot ^2(c+d x)}{a+a \sec (c+d x)} \, dx &=\frac{\int \cot ^4(c+d x) (-a+a \sec (c+d x)) \, dx}{a^2}\\ &=\frac{\cot ^3(c+d x) (1-\sec (c+d x))}{3 a d}+\frac{\int \cot ^2(c+d x) (3 a-2 a \sec (c+d x)) \, dx}{3 a^2}\\ &=-\frac{\cot (c+d x) (3-2 \sec (c+d x))}{3 a d}+\frac{\cot ^3(c+d x) (1-\sec (c+d x))}{3 a d}+\frac{\int -3 a \, dx}{3 a^2}\\ &=-\frac{x}{a}-\frac{\cot (c+d x) (3-2 \sec (c+d x))}{3 a d}+\frac{\cot ^3(c+d x) (1-\sec (c+d x))}{3 a d}\\ \end{align*}

Mathematica [A]  time = 0.768036, size = 100, normalized size = 1.64 \[ \frac{\sec (c+d x) \left (-12 d x \cos ^2\left (\frac{1}{2} (c+d x)\right )-\tan \left (\frac{1}{2} (c+d x)\right )+\sin \left (\frac{d x}{2}\right ) \cos \left (\frac{1}{2} (c+d x)\right ) \left (3 \csc \left (\frac{c}{2}\right ) \cot \left (\frac{1}{2} (c+d x)\right )+13 \sec \left (\frac{c}{2}\right )\right )\right )}{6 a d (\sec (c+d x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^2/(a + a*Sec[c + d*x]),x]

[Out]

(Sec[c + d*x]*(-12*d*x*Cos[(c + d*x)/2]^2 + Cos[(c + d*x)/2]*(3*Cot[(c + d*x)/2]*Csc[c/2] + 13*Sec[c/2])*Sin[(
d*x)/2] - Tan[(c + d*x)/2]))/(6*a*d*(1 + Sec[c + d*x]))

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 74, normalized size = 1.2 \begin{align*} -{\frac{1}{12\,da} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{3}}+{\frac{1}{da}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{da}}-{\frac{1}{4\,da} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2/(a+a*sec(d*x+c)),x)

[Out]

-1/12/a/d*tan(1/2*d*x+1/2*c)^3+1/a/d*tan(1/2*d*x+1/2*c)-2/d/a*arctan(tan(1/2*d*x+1/2*c))-1/4/a/d/tan(1/2*d*x+1
/2*c)

________________________________________________________________________________________

Maxima [A]  time = 1.73576, size = 126, normalized size = 2.07 \begin{align*} \frac{\frac{\frac{12 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac{\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a} - \frac{24 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac{3 \,{\left (\cos \left (d x + c\right ) + 1\right )}}{a \sin \left (d x + c\right )}}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2/(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/12*((12*sin(d*x + c)/(cos(d*x + c) + 1) - sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a - 24*arctan(sin(d*x + c)/(c
os(d*x + c) + 1))/a - 3*(cos(d*x + c) + 1)/(a*sin(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]  time = 1.08635, size = 170, normalized size = 2.79 \begin{align*} -\frac{4 \, \cos \left (d x + c\right )^{2} + 3 \,{\left (d x \cos \left (d x + c\right ) + d x\right )} \sin \left (d x + c\right ) + \cos \left (d x + c\right ) - 2}{3 \,{\left (a d \cos \left (d x + c\right ) + a d\right )} \sin \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2/(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

-1/3*(4*cos(d*x + c)^2 + 3*(d*x*cos(d*x + c) + d*x)*sin(d*x + c) + cos(d*x + c) - 2)/((a*d*cos(d*x + c) + a*d)
*sin(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\cot ^{2}{\left (c + d x \right )}}{\sec{\left (c + d x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2/(a+a*sec(d*x+c)),x)

[Out]

Integral(cot(c + d*x)**2/(sec(c + d*x) + 1), x)/a

________________________________________________________________________________________

Giac [A]  time = 1.33486, size = 89, normalized size = 1.46 \begin{align*} -\frac{\frac{12 \,{\left (d x + c\right )}}{a} + \frac{a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 12 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{a^{3}} + \frac{3}{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2/(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

-1/12*(12*(d*x + c)/a + (a^2*tan(1/2*d*x + 1/2*c)^3 - 12*a^2*tan(1/2*d*x + 1/2*c))/a^3 + 3/(a*tan(1/2*d*x + 1/
2*c)))/d